INTERVAL EVENT: Sometimes you need a program to constantly check something! Use an interval event for that.

Interval events run continuously at a set time frequency defined as the second parameter in the event handler.

  • Click Run and try playing the game. What happens when you've reached the right edge of the stage?
  • Look at the interval event in the program. It is constantly checking to see if the bat is past the x-value of 225.
  • It is checking this too infrequently! Speed it up by changing the number in the event handler to 0.1!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)